package demo3;

class student {
    String name;
    int age;
    void read(){
        System.out.println("大家好，我是" + name + "，年龄" + age);
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }
}
class Example03 {
    public static void main(String[] args) {
        student stu = new student();
        stu.name = "张三";
        stu.age = -18;
        stu.read();
    }
}
